<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="/favicon.ico" >
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="__STATIC__/js/lib/html5shiv.js"></script>
    <script type="text/javascript" src="__STATIC__/js/lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="__STATIC__/js/lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/h-ui.admin/css/style.css" />
    <link href="__STATIC__/js/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <script type="text/javascript" charset="utf-8" src="__STATIC__/js/lib/ueditor/1.4.3/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="__STATIC__/js/lib/ueditor/1.4.3/ueditor.all.min.js"></script>
    <script type="text/javascript" src="__STATIC__/js/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
    <!--/meta 作为公共模版分离出去-->
    <meta name="keywords" content="H-ui.admin v3.0,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
    <meta name="description" content="H-ui.admin v3.0，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<body>
<article class="page-container">
    <form  action="" method="post" class="form form-horizontal" id="form-add">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>文章标题：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text"  name="title" id="title">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>标签：</label>
            <div class="formControls col-xs-8 col-sm-9">
                {foreach name="labelData" item="list"}
                    <input type="checkbox" id="" name="label" value="<{$list['id']}>" ><{$list['label_name']}>&nbsp;&nbsp;
                {/foreach}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>文章类别：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <span class="select-box">
                     <select class="select" id="type" name="type">
                         {foreach item="type" name="data"}
                            <option value="<{$type['id']}>"><{$type['type_name']}></option>
                         {/foreach}
                     </select>
                </span>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>点赞数：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text"  name="dz_number" id="dz_number" >
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>文章内容：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <script type="text/plain" id="content" name="content" style="width:1000px;height:480px;"></script>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>是否原创：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <div class="radio-box">
                    <input name="is_yuan" type="radio" id="is_yuan-1" value="1" checked>
                    <label for="status-1">原</label>
                </div>
                <div class="radio-box">
                    <input type="radio" id="is_yuan-2" name="is_yuan"  value="2">
                    <label for="status-2">转</label>
                </div>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>状态：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <div class="radio-box">
                    <input name="status" type="radio" id="status-1" value="1" checked>
                    <label for="status-1">启用</label>
                </div>
                <div class="radio-box">
                    <input type="radio" id="status-2" name="status"  value="2">
                    <label for="status-2">停用</label>
                </div>
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input class="btn btn-success radius" type="button" onclick="add_article()" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                <input class="btn btn-danger radius" type="button" onclick="javascript:parent.window.layer.closeAll();" value="&nbsp;&nbsp;取消&nbsp;&nbsp;">
            </div>
        </div>
    </form>
</article>
<script type="text/javascript" src="__STATIC__/js/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__STATIC__/js/lib/jquery/1.9.1/jquery-form.js"></script>
<script type="text/javascript" src="__STATIC__/js/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="__STATIC__/css/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="__STATIC__/css/h-ui.admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="__STATIC__/js/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="__STATIC__/js/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="__STATIC__/js/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">
    var news_um = UE.getEditor('content');
    function add_article(){
        var label="";
        $("input[name=label]:checked").each(function(){
            label=label+$(this).val()+",";
        })
        $("#form-add").ajaxSubmit({
            type:"POST",
            url:"<{:url('admin/article/addArticle')}>",
            dataType:"json",
            data:{label:label},
            success:function(data){
                if(data.code==1){
                    layer.msg(data.msg,{icon:1,title:"系统提示",time:1000},function(){
                        parent.window.datatable.fnDraw();
                        parent.window.layer.closeAll();
                    })
                }else {
                    layer.msg(data.msg,{icon:2,titile:"系统提示",time:1000});
                }
            }
        })
    }
</script>
</body>
</html>